Program debugging is a process in which a compiled computer program is tested manually or by using a method such as a compiling program before being put into actual operation, so as to correct a syntax error and a logic error. This step is indispensable for ensuring correctness of a computer information system. Therefore, the compiled computer program needs to be loaded into a computer for debugging.
Generally, in the industry, code that runs in kernel space is referred to as kernel mode code, and code that runs in user space is referred to as user mode code. Currently, different debugging platforms need to be used to debug the kernel mode code and the user mode code. It should be noted that, a target machine described below refers to a physical host in which a debugged code runs, and a host machine described below refers to a physical host in which a debugger runs. For example, when user mode code is being debugged, a debugger needs to run in an operating system of a target machine to perform local debugging; or when user mode code is being debugged, a process tracing module (Ptrace) needs to be implanted into an operating system of a target machine, a debugging stub may further need to run in the operating system, and then a debugger runs in a host machine to perform remote debugging. When kernel mode code such as a kernel module is being debugged, a kernel debugger needs to be implanted into an operating system of a target machine, and then a debugger runs in a host machine to perform remote debugging.